package com.znf4.enums;

/**
 * 接口通道和通道编码枚举
 * @author zj
 */
public enum ChannelEnum {
	
	//channelCode(channel,channelMethod,desc)
	Q_R_B001("QIANBAO","report","钱包-报备",""),
	
	//汇享
	H_R_X001("HUIXIANG","report","汇享-报备",""),
	H_U_X001("HUIXIANG","update","汇享-报备更新",""),
	H_S_X001("HUIXIANG","sms","汇享支付" , "HUIXINAG_PARAMSCHECK_D0"),
	
	
	Y_R_D001("YIDIAN","report","一点即付-报备",""),
	Y_O_D001("YIDIAN","open","一点即付-开通",""),
	Y_U_D001("YIDIAN","update","一点即付-更新",""),
	Y_S_D001("YIDIAN","sms","一点即付-发送短信","YIDIAN_PARAMSCHECK_D0"),
	Y_P_D001("YIDIAN","pay","一点即付-确认支付","YIDIAN_PARAMSCHECK_D0"),
	
	Y_S_L001("YILIAN","sms","易联-发送短信","YILIAN_PARAMSCHECK_T0"),
	Y_P_L001("YILIAN","pay","易联-确认支付" , "YILIAN_PARAMSCHECK_T0"),
	T_P_F001("TENGFUTONG","sms","腾付通单笔单清通道(网页)" , "TFT_DanBiDanQing_PARAMSCHECK_T0");
	
	private String channel; //工厂实现类id
	private String channelMethod; //调用通道中的一个具体方法
	private String desc; //描述
	private String paramsCheck ; //参数校验

	private ChannelEnum(String channel, String channelMethod, String desc ,String paramsCheck) {
		this.channel = channel;
		this.channelMethod = channelMethod;
		this.desc = desc;
		this.paramsCheck = paramsCheck;
	}

	public String getParamsCheck() {
		return paramsCheck;
	}

	public void setParamsCheck(String paramsCheck) {
		this.paramsCheck = paramsCheck;
	}

	public String getChannel() {
		return channel;
	}

	public void setChannel(String channel) {
		this.channel = channel;
	}

	public String getChannelMethod() {
		return channelMethod;
	}

	public void setChannelMethod(String channelMethod) {
		this.channelMethod = channelMethod;
	}

	public String getDesc() {
		return desc;
	}
	
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static ChannelEnum getEnum(String name) {
		ChannelEnum[] arry = ChannelEnum.values();
		for (int i = 0; i < arry.length; i++) {
			if (arry[i].name().equalsIgnoreCase(name)) {
				return arry[i];
			}
		}
		return null;
	}

}
